package com.longtop.model;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Config implements ApplicationContextAware{
	
	private static ApplicationContext ctx  = new ClassPathXmlApplicationContext("applicationContext.xml");;
	
	@Override
	public void setApplicationContext(ApplicationContext arg0)
			throws BeansException {
		// TODO Auto-generated method stub
//		ApplicationContext appContext 
//        = new ClassPathXmlApplicationContext("applicationContext.xml");
//		ctx = appContext;
	}
	
	public static Object getBean(String beanName) {
		//ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(flex.messaging.FlexContext.getServletConfig().getServletContext());
		return ctx.getBean(beanName);
	}
}
